<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Log;

class WechatController extends Controller
{
    public function serve()
    {

        Log::info('request arrived');

        $app = app('wechat.official_account');
        $app->server->push(function ($message) {
            return "欢迎关注！";
        });

        return $app->server->serve();
    }

    public function userinfo()
    {
        $user = session('wechat.oauth_user.default');

        dd($user);
    }
}
